Namespace - LJCAddressParserLib
Parameters
currentToken - The token value.
currentIndex - The token index value.
Returns
true if the token is a Predirectional; otherwise, false.
Syntax
| C# |
|
public Boolean ParsePreDirectional(String currentToken, Int32& currentIndex)
|
Parses a token into the PreDirectional Property.
Remarks
Increments currentIndex by one if the token is a PreDirectional.
The vertical bar indicates the Current Token Index.
Check current token for PreDirectional.
If the token appears to be a PreDirectional.
a. If there is not at least one available value after the directional
and before the first post-street value, then the current token must be
the street name.
|
Before: 123 North Street
Do not use the current token as a PreDirectional.
The PreDirectional Parsing ends.
b. If there is at least one available value after the directional and before
the first post-street value, then the current token is not the street name.
|
Before: 123 North East Main Street
Set the PreDirectional property to the current token and increment the
current token index.
PreDirectional = "N".
|
After: 123 North East Main Street
Check for Multi-word PreDirectional.
If the preceding directional is "N" or "S" and the current directional
is "E" or "W".
If there is at least one available value including the directional and
before the first post-street value.
|
Before: 123 North East Main Street
Create the two character PreDirectional and increment the current
token index.
PreDirectional = "NE".
|
After: 123 North East Main Street
Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.